package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.KjtWithdrawStatus;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * Created by Huqin on 2020/8/17
 */
@Data
@Entity
@Table(name = "withdraw_his")
@org.hibernate.annotations.Table(appliesTo = "withdraw_his", comment = "提现历史")
public class WithdrawHisEntity {

    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(columnDefinition = ("varchar(40) not null comment '子商户Id'"))
    private String subMerchantId;

    @Column(columnDefinition = ("varchar(40) not null comment '用户Id'"))
    private String userId;

    @Column(unique = true, columnDefinition = ("varchar(32) not null comment '快捷通订单号'"))
    private String outTradeNo;

    @Column(columnDefinition = ("varchar(32) not null comment '收款户名'"))
    private String payeeName;

    @Column(columnDefinition = ("int(10) not null comment '提现金额'"))
    private Integer withdrawalAmount;

    @Column(columnDefinition = ("varchar(32) not null comment '转账状态'"))
    @Enumerated(EnumType.STRING)
    private KjtWithdrawStatus withdrawStatus;

    @Column(columnDefinition = ("varchar(128) default null comment '失败原因'"))
    private String failReason;

    @Column(columnDefinition = ("datetime not null comment '转账时间'"))
    private LocalDateTime withdrawTime;

}
